package de.muahd.saga.ui.springmvc.config;

import org.springframework.beans.factory.aspectj.EnableSpringConfigured;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;
import org.springframework.validation.beanvalidation.MethodValidationPostProcessor;

import de.muahd.saga.services.core.config.CoreApplication;

@Configuration
@ComponentScan(basePackages={"de.muahd.saga"})
@EnableSpringConfigured
@Import(value={MVCConfig.class, CoreApplication.class, Security.class})
public class Application {

	@Bean
	public LocalValidatorFactoryBean validator() {
		return new LocalValidatorFactoryBean();
	}
	
	@Bean
	public MethodValidationPostProcessor methodValidationPostProcessor() {
		return new MethodValidationPostProcessor();
	}
	
}
